home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4326 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.5 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solutions.solon.com (Peter Seebach)
  3. Newsgroups: comp.lang.c,alt.religion.kibology
  4. Subject: Re: Question1
  5. Date: 3 Feb 1996 10:04:48 -0600
  6. Organization: Usenet Fact Police (Undercover)
  7. Message-ID: <4f0130$co4@solutions.solon.com>
  8. References: <4eur2g$oaq@recepsen.aa.msen.com>
  9. NNTP-Posting-Host: solutions.solon.com
  10.  
  11. In article <4eur2g$oaq@recepsen.aa.msen.com>,
  12. Casey <casey@conch.aa.msen.com> wrote:
  13. >For each tyep listed below, explain what sort of object can be stored in 
  14. >variables of that type and igve 2 examples:
  15.  
  16. >a.  char
  17.  
  18.     A char holds an integer value.  Examples:
  19.  
  20.     char coal = 32;
  21.     char woman = 16;
  22.  
  23. >b.  int
  24.  
  25.     An int holds a numeric value.  Examples:
  26.  
  27.     int pi = 3.14159;
  28.     int i = sqrt(-1);
  29.  
  30. >c.  float
  31.  
  32.     A float variable can change during execution.  Examples:
  33.  
  34.     float f = 1, g = 3;
  35.  
  36.     f = g; /* assigns g to f, causing f to 'float' */
  37.  
  38. >d.  long int
  39.  
  40.     A long int has more digits than an int.  Examples:
  41.  
  42.     long int ten = 00000012;
  43.     long int hex = 0x15;
  44.  
  45.     You can enter a long using "0x" to mean hex.
  46.  
  47. >e.  unsigned int
  48.  
  49.     An unsigned int is one written without the + or - signs.
  50.  
  51.     Examples:
  52.  
  53.     unsigned int three = 1 / 3;
  54.     unsigned int mult = 2 * 4;
  55.  
  56. Hope This Helps!
  57.  
  58. -s
  59. -- 
  60. Peter Seebach - seebs@solon.com - Copyright 1995 Peter Seebach.
  61. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  62. Using trn?  Weird new newsgroup problem?  I know the fix!  Email me!
  63. The *other* C FAQ - ftp taniemarie.solon.com /pub/c/afq - Not A Flying Toy
  64.